#ifndef PUMP_H
#define PUMP_H
#include <QBrush>
#include <QPainter>
#include <QColor>
#include <QPointF>
#include <QLinearGradient>
#include <QGraphicsItem>
#include <cmath>

class Pump : public QGraphicsItem, public QObject
{
public:
    enum {Type = UserType + 1};

    explicit Pump(int dimension=40, int status=0, QGraphicsItem *parent=0);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    QRectF boundingRect() const;
    int type() const { return Type; }

    void changeStatus();

signals:
    void statusChanged();

private:
    void createBrush();

    QBrush m_brush;
    QLinearGradient m_gradient_green;
    QLinearGradient m_gradient_red;

    int m_dimension;
    int m_status;
};

#endif // PUMP_H
